﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TRTCMain.Controls
{
    public partial class CloseAllVideo : UserControl
    {
        public delegate void BtnClickHandler();
        public event BtnClickHandler BtnClicked;

        public CloseAllVideo()
        {
            InitializeComponent();
            this.Click += Label_Click;
            this.label.Click += Label_Click;
            this.pictureBox.Click += Label_Click;
            this.MouseMove += MicroButton_MouseMove; ;
            this.MouseLeave += MicroButton_MouseLeave; ;
            pictureBox.MouseMove += PictureBox_MouseMove; ;
            pictureBox.MouseLeave += PictureBox_MouseLeave; ;
            label.MouseMove += Label_MouseMove; ;
            label.MouseLeave += Label_MouseLeave;
        }

        private void Label_MouseLeave(object sender, EventArgs e)
        {
            this.BackColor = Color.FromArgb(32, 34, 36);
        }

        private void Label_MouseMove(object sender, MouseEventArgs e)
        {
            this.BackColor = Color.FromArgb(69, 70, 72);
        }

        private void PictureBox_MouseLeave(object sender, EventArgs e)
        {
            this.BackColor = Color.FromArgb(32, 34, 36);
        }

        private void PictureBox_MouseMove(object sender, MouseEventArgs e)
        {
            this.BackColor = Color.FromArgb(69, 70, 72);
        }

        private void MicroButton_MouseLeave(object sender, EventArgs e)
        {
            this.BackColor = Color.FromArgb(32, 34, 36);
        }

        private void MicroButton_MouseMove(object sender, MouseEventArgs e)
        {
            this.BackColor = Color.FromArgb(69, 70, 72);
        }

        private void Label_Click(object sender, EventArgs e)
        {
            BtnClicked?.Invoke();
        }
    }
}
